package com.pls.data;

import java.util.ArrayList;
import java.util.List;

import com.pls.entity.Employee;
import com.pls.mapper.EmployeeMapper;
import com.pls.mapper.Mapper;

public class EmployeeData {
	private final String selectEmployee = "select * from employee";

	//Sample Get All Employees Mapper Implementation
	public List<Employee> getAllEmployees() {
		List<Employee> employeeList = new ArrayList<Employee>();
		DataHelper<Employee> dataHelper = new DataHelper<Employee>();
		Mapper<Employee> mapper = new EmployeeMapper();

		employeeList = dataHelper.ExecuteQuery(selectEmployee, mapper);

		return employeeList;
	}
	
	public Employee getEmployeeById(int id) {
		String selectQuery = "select * from employee where employee_id = " + id;
		Employee emp = new Employee();
		DataHelper<Employee> dataHelper = new DataHelper<Employee>();
		Mapper<Employee> mapper = new EmployeeMapper();

		emp = dataHelper.ExecuteQuerySingle(selectQuery, mapper);

		return emp;
	} 

}
